<template>
  <div class="process">    
      <otherform
        :step="step"
        :status="status"
        :process-instance-id="processInstanceId"
        :process-definition-key="processDefinitionKey"
        :task-id="taskId"     
      ></otherform>
      <process
        :step="step"
        :status="status"
        :process-instance-id="processInstanceId"
        :task-id="taskId"
      ></process>
    </div>  
</template>
<script>
import processApi from '@/api/process'
import { getParameterByName } from '@/utils/util'
import otherform from './MesQcQualityImproveTask_1Modal.vue'
import process from './process/process.vue'
import Vue from 'vue'
export default {
  components: {
    otherform,
    process
  },
  data () {
    return {
      status: '',
      step: getParameterByName('route'),
      processInstanceId: getParameterByName('processInstanceId'),
      processDefinitionKey: getParameterByName('processDefinitionKey'),
      taskId: getParameterByName('taskId')
    }
  },
  computed: {},
  methods: {},
  created () {
    // action:   create(流程创建)    todo（待办，对应status 1） complete（已办,对应status 2)
    const action = getParameterByName('action')
    if (action === 'todo') {
      this.status = '1'
    } else if (action === 'complete') {
      this.status = '2'
    } else {
      this.status = action
    }
   
    if ( action === 'create' ){    
      processApi.getProcessParams(getParameterByName('processDefinitionKey')).then( res =>{
        const curData = res.data
         console.log('curData：' + curData)
        this.processDefinitionName = curData.processDefinitionName
      })}
    console.log('状态：' + this.status) 
    console.log('步骤：' + this.step)  
  },
  destroyed () { 
  }
}
</script>
<style scoped lang="less">
.process {
  height: 100%;
  .process-tpl-pc {
    width: 1200px;
    margin: 0 auto;
    border: 1px solid #e8e8e8;
    padding: 20px;
  }
}
</style>
